﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ChucNang_Admin_Admin_ThongKeKhuyenMaiSanPhamTheoThang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnThongKe_Click(object sender, EventArgs e)
    {
        lbTenSanPham.Visible = true;
        imgSanPham.Visible = true;
        DataDSTableAdapters.KHUYENMAI_CHITIETKHUYENMAI_HINHTHUCKHUYENMAI_SANPHAMTableAdapter adapter = new DataDSTableAdapters.KHUYENMAI_CHITIETKHUYENMAI_HINHTHUCKHUYENMAI_SANPHAMTableAdapter();
        DataDSTableAdapters.SANPHAMTableAdapter spadapter = new DataDSTableAdapters.SANPHAMTableAdapter();
        DataDS.SANPHAMDataTable sptable = new DataDS.SANPHAMDataTable();
        int id_sp = int.Parse(dropdownlistSanPham.SelectedValue.ToString());
        int thang = int.Parse(dropdownlistThang.SelectedValue.ToString());
        int nam = int.Parse(dropdownlistNam.SelectedValue.ToString());
        sptable=spadapter.SANPHAM_LayTheoIdSP(id_sp);
        imgSanPham.ImageUrl = sptable.Rows[0]["HinhAnh"].ToString();
        imgSanPham.DataBind();
        lbTenSanPham.Text=sptable.Rows[0]["TenSP"].ToString();
        lbTenSanPham.DataBind();
        GridView1.DataSource = adapter.KHUYENMAI_CHITIETKHUYENMAI_HINHTHUCKHUYENMAI_SANPHAM_ThongKeTheoThang(thang, nam, id_sp);
        GridView1.DataBind();
    }
}
